package com.itfreer.power.service.organize;

import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

import com.itfreer.form.api.BaseDao;
import com.itfreer.form.api.imp.DictionaryServiceImp;
import com.itfreer.form.dictionary.base.DictionaryItem;
import com.itfreer.power.dao.organize.WorkingGroupDao;
import com.itfreer.power.entity.organize.WorkingGroupEntity;
/**
 * 工作组管理实现类
 */
@Component("workingGroupService")
public class WorkingGroupServiceBase extends DictionaryServiceImp<WorkingGroupEntity> implements WorkingGroupService {

	@Autowired
	private WorkingGroupDao workingGroupDao;

	@Override
	public String getDictionaryName() {
		return "p_working_group";
	}

	@Override
	protected DictionaryItem convert(WorkingGroupEntity entity) {
		DictionaryItem toEntity = new DictionaryItem();
		BeanUtils.copyProperties(entity, toEntity);
		return toEntity;
	}

	@Override
	protected String getDictionaryFields() {
		return "id,code,display,valid,order";
	}

	@Override
	protected BaseDao<WorkingGroupEntity> getDao() {
		return workingGroupDao;
	}
}
